﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp5
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            InitializeComponent();
           
        }

        private void formateFrom()
        {
            this.LayoutMdi(MdiLayout.TileVertical);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void 显示ToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void 显示学生信息ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            StudentForm sf = new StudentForm();
            sf.MdiParent = this;
            sf.Show();
            formateFrom();
        }

        private void 显示教师信息ToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            TeacherForm tf = new TeacherForm();
            tf.MdiParent = this;
            tf.Show();
            formateFrom();
        }

        private void 关闭所有子窗口ToolStripMenuItem_Click_1(object sender, EventArgs e)
        {

            if (this.MdiChildren != null)
            {
                Form[] f = this.MdiChildren;
                for (int i = 0; i < f.Length; i++)
                {
                    f[i].Close();
                }
            }
            
        }

        private void 显示课程信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LessonForm lf = new LessonForm();
            lf.MdiParent = this;
            lf.Show();
            formateFrom();
        }

        private void 显示班级信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ClassForm cf = new ClassForm();
            cf.MdiParent = this;
            cf.Show();
            formateFrom();
        }

        private void 查询成绩ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Grades.ShowGrade sd = new Grades.ShowGrade();
            sd.MdiParent = this;
            sd.Show();
            formateFrom();
        }

        private void 录入成绩ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Grades.newAddGrade ag = new Grades.newAddGrade();
            ag.MdiParent = this;
            ag.Show();
            formateFrom();

        }
    }
}
